export interface ResponseData<T> {
  code: number;
  message: string;
  data: T;
  trace_id: string;
  total?: number;
  page?: number;
  size?: number;
  pages?: number;
}

export interface User {
  id: number;
  username: string;
  email: string;
  role: 'enterprise' | 'tutor' | 'student' | 'admin';
  status: 'pending' | 'approved' | 'rejected' | 'suspended';
  real_name: string;
  avatar: string;
  phone: string;
  created_at: string;
  updated_at: string;
  enterprise?: {
    id: number;
    user_id: number;
    company_name: string;
    industry: string;
    company_size: string;
    location: string;
    website: string;
    description: string;
  };
  tutor?: {
    id: number;
    user_id: number;
    employee_id: string;
    department: string;
    title: string;
    research_field: string;
    experience: string;
    introduction: string;
  };
  student?: {
    id: number;
    user_id: number;
    student_id: string;
    major: string;
    grade: string;
    research_field: string;
    skills: string;
    experience: string;
    introduction: string;
  };
}

export interface Project {
  id: number;
  title: string;
  description: string;
  requirements: string;
  budget: number;
  deadline: string;
  category: string;
  tags: string;
  status: 'open' | 'closed' | 'in_progress' | 'completed';
  contact_info?: string;
  is_public: boolean;
  view_count: number;
  apply_count: number;
  priority: number;
  location: string;
  skills: string;
  duration: number;
  max_applicants: number;
  current_applicants: number;
  start_date?: string | null;
  end_date?: string | null;
  creator_id: number;
  created_at: string;
  updated_at: string;
  creator?: {
    id: number;
    username: string;
    real_name: string;
    role: string;
  };
  applications?: {
    id: number;
    status: string;
    applicant_id: number;
    cover_letter: string;
    created_at: string;
  }[];
  matched_users?: any[];
}

export interface Application {
  id: number;
  project_id: number;
  applicant_id: number;
  status: 'pending' | 'accepted' | 'rejected' | 'withdrawn';
  cover_letter: string;
  resume: string;
  portfolio: string;
  research_plan?: string;
  motivation?: string;
  qualifications?: string;
  expected_time?: number;
  start_date?: string;
  end_date?: string;
  reviewer_id?: number | null;
  review_comment?: string;
  review_date?: string | null;
  apply_date: string;
  created_at: string;
  updated_at: string;
  project?: {
    id: number;
    title: string;
    description: string;
    status: string;
    creator_id: number;
  };
  applicant?: {
    id: number;
    username: string;
    real_name: string;
    role: string;
    email: string;
  };
  reviewer?: {
    id: number;
    username: string;
    real_name: string;
    role: string;
  } | null;
}

export interface Statistics {
  total_users: number;
  total_projects: number;
  total_applications: number;
  total_matches: number;
  active_projects: number;
  pending_applications: number;
}

export interface ExportData {
  download_url: string;
  filename: string;
}

// 仪表盘统计数据
export interface DashboardStats {
  userCount: number;
  userGrowth: number;
  projectCount: number;
  projectGrowth: number;
  applicationCount: number;
  applicationGrowth: number;
}

// 用户图表数据
export interface UserChartData {
  labels: string[];
  data: number[];
}

// 课题图表数据
export interface ProjectChartData {
  series: {
    name: string;
    value: number;
    itemStyle?: {
      color?: string;
    };
  }[];
}

// 活动项
export interface ActivityItem {
  id: number;
  icon: string;
  title: string;
  description: string;
  time: string;
}

// 待办事项
export interface TodoItem {
  id: number;
  title: string;
  description?: string;
  completed: boolean;
  createdAt: string;
  updatedAt: string;
}

// 用户状态枚举
export enum UserStatus {
  Active = "active",
  Inactive = "inactive",
  Pending = "pending"
}

// 课题状态枚举
export enum ProjectStatus {
  Closed = "closed",
  Completed = "completed",
  InProgress = "in_progress",
  Open = "open"
}

// 申请状态枚举
export enum ApplicationStatus {
  Accepted = "accepted",
  Pending = "pending",
  Rejected = "rejected",
  Withdrawn = "withdrawn"
}

// 统计信息接口
export interface StatisticsData {
  active_projects?: number;
  pending_applications?: number;
  total_applications?: number;
  total_matches?: number;
  total_projects?: number;
  total_users?: number;
  [property: string]: any;
}

// 导出统计信息接口
export interface ExportStatisticsData {
  download_url?: string;
  filename?: string;
  [property: string]: any;
}
